
public class ExpressionComplexe extends Expression {
	private Expression e1;
	private Expression e2;
	private char op;
	
	public ExpressionComplexe(Expression a, char op, Expression b)
	{
		this.e1 = a;
		this.e2 = b;
		this.op = op;
	}
	
	public double eval() {
		
		switch(this.op)
		{
			case '+' : return e1.eval() + e2.eval();
			case '*' : return e1.eval() * e2.eval();
			case '-' : return e1.eval() - e2.eval();
			case '/' : return e1.eval() / e2.eval();
			default : 
				break;
		}
		
		return 0;
	}

}
